/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.own.entity;

import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import com.jeesite.common.mybatis.annotation.JoinTable;
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
import com.fasterxml.jackson.annotation.JsonFormat;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 药材检验信息Entity
 * @author F
 * @version 2019-09-27
 */
@Table(name="own_medicine_inspection_information", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一ID", isPK=true),
		@Column(name="own_medicine_receipt_information_id", attrName="ownMedicineReceiptInformationId", label="药材收获信息ID", isQuery=false),
		@Column(name="medicine_batch_id", attrName="medicineBatchId", label="药材批次号"),
		@Column(name="check_method", attrName="checkMethod", label="检验方法"),
		@Column(name="check_grade", attrName="checkGrade", label="质量级别"),
		@Column(name="check_thick_method", attrName="checkThickMethod", label="粗加工方法"),
		@Column(name="check_condition", attrName="checkCondition", label="贮藏条件"),
		@Column(name="check_user", attrName="checkUser", label="检验人员"),
		@Column(name="check_time", attrName="checkTime", label="检验时间"),
		@Column(name="report_type", attrName="reportType", label="检验报告类型"),
		@Column(name="report_address", attrName="reportAddress", label="检验报告地址"),
		@Column(name="residual_weight", attrName="residualWeight", label="药材剩余重量"),
		@Column(name="bm_batch_code", attrName="bmBatchCode", label="药材批次码"),
		@Column(name="create_company", attrName="createCompany", label="所属企业标识", isUpdate=false, isQuery=false),
		@Column(name ="uuid", attrName ="uuid",label = "操作标识符"),
		@Column(name="txid", attrName ="txid",label = "返回的txid"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.update_date DESC"
)
public class OwnMedicineInspectionInformation extends DataEntity<OwnMedicineInspectionInformation> {
	
	private static final long serialVersionUID = 1L;
	private String ownMedicineReceiptInformationId;		// 药材收获信息ID
	private String medicineBatchId;		// 药材批次号
	private String checkMethod;		// 检验方法
	private String checkGrade;		// 质量级别
	private String checkThickMethod;		// 粗加工方法
	private String checkCondition;		// 贮藏条件
	private String checkUser;		// 检验人员
	private Date checkTime;		// 检验时间
	private String reportType; //检验报告类型
	private String reportAddress; //检验报告地址
	private String bmBatchCode;		// 药材批次码
	private Double residualWeight; //药材剩余重量
	private String createCompany;		// 所属企业标识
	private String uuid;		//索引本次操作的上下本标识
	private String txid;

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getTxid() {
		return txid;
	}

	public void setTxid(String txid) {
		this.txid = txid;
	}

	public OwnMedicineInspectionInformation() {
		this(null);
	}

	public OwnMedicineInspectionInformation(String id){
		super(id);
	}

	@NotBlank(message="药材收获信息ID不能为空")
	@Length(min=0, max=64, message="药材收获信息ID长度不能超过 64 个字符")
	public String getOwnMedicineReceiptInformationId() {
		return ownMedicineReceiptInformationId;
	}

	public void setOwnMedicineReceiptInformationId(String ownMedicineReceiptInformationId) {
		this.ownMedicineReceiptInformationId = ownMedicineReceiptInformationId;
	}
	
	@NotBlank(message="药材批次号不能为空")
	@Length(min=0, max=25, message="药材批次号长度不能超过 25 个字符")
	public String getMedicineBatchId() {
		return medicineBatchId;
	}

	public void setMedicineBatchId(String medicineBatchId) {
		this.medicineBatchId = medicineBatchId;
	}

	@NotBlank(message="检验方法不能为空")
	@Length(min=0, max=50, message="检验方法长度不能超过 50 个字符")
	public String getCheckMethod() {
		return checkMethod;
	}

	public void setCheckMethod(String checkMethod) {
		this.checkMethod = checkMethod;
	}

	@NotBlank(message="质量级别不能为空")
	@Length(min=0, max=10, message="质量级别长度不能超过 10 个字符")
	public String getCheckGrade() {
		return checkGrade;
	}

	public void setCheckGrade(String checkGrade) {
		this.checkGrade = checkGrade;
	}

	@NotBlank(message="粗加工方法不能为空")
	@Length(min=0, max=30, message="粗加工方法长度不能超过 30 个字符")
	public String getCheckThickMethod() {
		return checkThickMethod;
	}

	public void setCheckThickMethod(String checkThickMethod) {
		this.checkThickMethod = checkThickMethod;
	}

	@NotBlank(message="贮藏条件不能为空")
	@Length(min=0, max=50, message="贮藏条件长度不能超过 50 个字符")
	public String getCheckCondition() {
		return checkCondition;
	}

	public void setCheckCondition(String checkCondition) {
		this.checkCondition = checkCondition;
	}

	@NotBlank(message="检验人员不能为空")
	@Length(min=0, max=50, message="检验人员长度不能超过 50 个字符")
	public String getCheckUser() {
		return checkUser;
	}

	public void setCheckUser(String checkUser) {
		this.checkUser = checkUser;
	}

	@NotNull(message="检验时间不能为空")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	public Date getCheckTime() {
		return checkTime;
	}

	public void setCheckTime(Date checkTime) {
		this.checkTime = checkTime;
	}

	@NotBlank(message="检验报告类型不能为空")
	@Length(min=0, max=50, message="检验报告类型长度不能超过 50 个字符")
	public String getReportType() {
		return reportType;
	}

	public void setReportType(String reportType) {
		this.reportType = reportType;
	}

	@NotBlank(message="检验报告地址不能为空")
	public String getReportAddress() {
		return reportAddress;
	}

	public void setReportAddress(String reportAddress) {
		this.reportAddress = reportAddress;
	}

	@NotBlank(message="药材批次码不能为空")
	@Length(min=0, max=50, message="药材批次码长度不能超过 50 个字符")
	public String getBmBatchCode() {
		return bmBatchCode;
	}

	public void setBmBatchCode(String bmBatchCode) {
		this.bmBatchCode = bmBatchCode;
	}

	@NotNull(message="剩余重量不能为空")
	public Double getResidualWeight() {
		return residualWeight;
	}

	public void setResidualWeight(Double residualWeight) {
		this.residualWeight = residualWeight;
	}
	
	@Length(min=0, max=64, message="所属企业标识长度不能超过 64 个字符")
	public String getCreateCompany() {
		return createCompany;
	}

	public void setCreateCompany(String createCompany) {
		this.createCompany = createCompany;
	}

	public String[] getCheckGrade_in() {
		return sqlMap.getWhere().getValue("check_grade", QueryType.IN);
	}

	public void setCheckGrade_in(String[] checkGrades) {
		sqlMap.getWhere().and("check_grade", QueryType.IN, checkGrades);
	}
	
}